import { useDialog } from '@/stores/dialogSwitch.js'
// 引入pinia的事件信息
import { useDialogEvents } from '@/stores/dialogEvents.js'
// 引入拉框查询de中地接口
import { storeToRefs } from 'pinia'
import { Query } from '@/Utils/Query.js'
const { allEventsDialogVisible } = storeToRefs(useDialog())
const { allEvents } = storeToRefs(useDialogEvents())
// 查看所有事件
export const viewAllEvents = () => {
  // 查询事件点图层的所有事件
  var service = {
    name: 'guanggu',
    layerId: 2
  }
  Query.queryByLayer({
    service,
    callback: (res) => {
      if (res) {
        allEvents.value = res
        //  1. 打开所有事件列表对话框
        allEventsDialogVisible.value = true
      }
    }
  })
}
